package com.example.consumer_order_feign_disable_special.feign;

import feign.Feign;
import feign.Request;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

@Configuration
public class DisableFeignConfiguration {

    @Bean
    @Scope("prototype")
    public Feign.Builder feignBuilder(){
        return Feign.builder();
    }

    /**设置feign的超时时间*/
    @Bean
    public Request.Options options() {
        return new Request.Options(10000, 10000);
    }

    /**设置feign不retry*/
    @Bean
    public Retryer feignRetryer() {
        return Retryer.NEVER_RETRY;
    }

}
